﻿@{
    WebSecurity.RequireAuthenticatedUser();
    Layout = "~/_SiteLayout.cshtml";
    Page.Region = RefDataManager.GetRegionLkUpVal();
    Page.IDType = RefDataManager.GetIDTypeLkUpVal();
    Page.Title="Downloads";
    
    //get all files from the content folder
    //Activation,Delivery,Printing,CashCash
    
    string[] activation = Directory.GetFiles(Server.MapPath("~/Content/Activation/"));
    string[] delivery = Directory.GetFiles(Server.MapPath("~/Content/Delivery/"));
    string[] printing = Directory.GetFiles(Server.MapPath("~/Content/Printing/"));
    
     Array.Reverse(activation);
     Array.Reverse(delivery);
     Array.Reverse(printing);
   
     


}
<style>
    .download 
{
height:200px;
overflow:scroll;
}
</style>
<script>
    $(function() {
        $("#fileTab").tabs();
    });
    
</script>
<div id="fileTab">
    <ul>
        <li><a href="#tab1">Activation</a></li>
        <li><a href="#tab2">Delivery</a></li>
        <li><a href="#tab3">Printing</a></li>
    </ul>
    <div id="tab1" class="download">
   
     @foreach(var s in activation){
        string filename = Path.GetFileName(s);
        <p><a href="@Href("~/Content/Activation/"+@filename)">@filename</a></p>
    }
</div>
<div id="tab2" class="download">
   
     @foreach(var s in delivery){
        string filename = Path.GetFileName(s);
        <p><a href="@Href("~/Content/Delivery/"+@filename)">@filename</a></p>
    }
</div>
<div id="tab3" class="download">
    
     @foreach(var s in printing){
        string filename = Path.GetFileName(s);
        <p><a href="@Href("~/Content/Printing/"+@filename)">@filename</a></p>
    }
</div>    
</div>


    </div>